/** *  */package com.ufgov.zc.client.zc.zcebyanshou;import java.awt.BorderLayout;import java.awt.Color;import java.awt.DefaultKeyboardFocusManager;import java.awt.Dialog.ModalityType;import java.awt.Dimension;import java.awt.FlowLayout;import java.awt.Font;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.math.BigDecimal;import java.util.ArrayList;import java.util.Date;import java.util.List;import javax.swing.BorderFactory;import javax.swing.JComponent;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.JTabbedPane;import javax.swing.JTextArea;import javax.swing.border.TitledBorder;import javax.swing.event.TableModelEvent;import javax.swing.event.TableModelListener;import javax.swing.table.TableModel;import org.apache.log4j.Logger;import com.ufgov.smartclient.common.UIUtilities;import com.ufgov.smartclient.component.table.fixedtable.JPageableFixedTable;import com.ufgov.zc.client.common.AsOptionMeta;import com.ufgov.zc.client.common.BillElementMeta;import com.ufgov.zc.client.common.ListCursor;import com.ufgov.zc.client.common.MyTableModel;import com.ufgov.zc.client.common.ServiceFactory;import com.ufgov.zc.client.common.WorkEnv;import com.ufgov.zc.client.common.converter.zc.ZcEbYanShouBillToTableModelConverter;import com.ufgov.zc.client.component.DateField;import com.ufgov.zc.client.component.GkBaseDialog;import com.ufgov.zc.client.component.GkCommentDialog;import com.ufgov.zc.client.component.GkCommentUntreadDialog;import com.ufgov.zc.client.component.JFuncToolBar;import com.ufgov.zc.client.component.JTablePanel;import com.ufgov.zc.client.component.button.AddButton;import com.ufgov.zc.client.component.button.AgreeButton;import com.ufgov.zc.client.component.button.AuditFinalPassButton;import com.ufgov.zc.client.component.button.AuditPassButton;import com.ufgov.zc.client.component.button.CaigouRenCheckButton;import com.ufgov.zc.client.component.button.CallbackButton;import com.ufgov.zc.client.component.button.DeleteButton;import com.ufgov.zc.client.component.button.DisagreeButton;import com.ufgov.zc.client.component.button.EditButton;import com.ufgov.zc.client.component.button.ExitButton;import com.ufgov.zc.client.component.button.FuncButton;import com.ufgov.zc.client.component.button.IsSendToNextButton;import com.ufgov.zc.client.component.button.NextButton;import com.ufgov.zc.client.component.button.OrganizerCheckButton;import com.ufgov.zc.client.component.button.PreviousButton;import com.ufgov.zc.client.component.button.PrintButton;import com.ufgov.zc.client.component.button.PrintPreviewButton;import com.ufgov.zc.client.component.button.ProviderCheckButton;import com.ufgov.zc.client.component.button.SaveButton;import com.ufgov.zc.client.component.button.SendButton;import com.ufgov.zc.client.component.button.SendToProcurementUnitButton;import com.ufgov.zc.client.component.button.SendToXieBanButton;import com.ufgov.zc.client.component.button.SubaddButton;import com.ufgov.zc.client.component.button.SubdelButton;import com.ufgov.zc.client.component.button.SubinsertButton;import com.ufgov.zc.client.component.button.SuggestAuditPassButton;import com.ufgov.zc.client.component.button.TraceButton;import com.ufgov.zc.client.component.button.UnauditButton;import com.ufgov.zc.client.component.button.UntreadButton;import com.ufgov.zc.client.component.button.YanShouTeamCheckButton;import com.ufgov.zc.client.component.table.BeanTableModel;import com.ufgov.zc.client.component.table.celleditor.MoneyCellEditor;import com.ufgov.zc.client.component.table.celleditor.TextCellEditor;import com.ufgov.zc.client.component.table.cellrenderer.NumberCellRenderer;import com.ufgov.zc.client.component.ui.fieldeditor.AbstractFieldEditor;import com.ufgov.zc.client.component.zc.AbstractMainSubEditPanel;import com.ufgov.zc.client.component.zc.fieldeditor.AsValFieldEditor;import com.ufgov.zc.client.component.zc.fieldeditor.AutoNumFieldEditor;import com.ufgov.zc.client.component.zc.fieldeditor.CompanyFieldEditor;import com.ufgov.zc.client.component.zc.fieldeditor.DateFieldEditor;import com.ufgov.zc.client.component.zc.fieldeditor.FileFieldEditor;import com.ufgov.zc.client.component.zc.fieldeditor.ForeignEntityFieldEditor;import com.ufgov.zc.client.component.zc.fieldeditor.TextFieldEditor;import com.ufgov.zc.client.util.SwingUtil;import com.ufgov.zc.client.zc.ButtonStatus;import com.ufgov.zc.client.zc.ZcUtil;import com.ufgov.zc.client.zc.ztb.activex.WordPane;import com.ufgov.zc.common.commonbiz.publish.IBaseDataServiceDelegate;import com.ufgov.zc.common.system.Guid;import com.ufgov.zc.common.system.RequestMeta;import com.ufgov.zc.common.system.constants.ZcElementConstants;import com.ufgov.zc.common.system.constants.ZcSettingConstants;import com.ufgov.zc.common.system.dto.ElementConditionDto;import com.ufgov.zc.common.system.util.DigestUtil;import com.ufgov.zc.common.system.util.ObjectUtil;import com.ufgov.zc.common.zc.foreignentity.IForeignEntityHandler;import com.ufgov.zc.common.zc.model.ZcBaseBill;import com.ufgov.zc.common.zc.model.ZcEbProtocol;import com.ufgov.zc.common.zc.model.ZcEbYanShouBill;import com.ufgov.zc.common.zc.model.ZcEbYanShouBillItem;import com.ufgov.zc.common.zc.model.ZcPProMake;import com.ufgov.zc.common.zc.model.ZcTBchtItem;import com.ufgov.zc.common.zc.model.ZcXmcgHt;import com.ufgov.zc.common.zc.publish.IZcEbBaseServiceDelegate;import com.ufgov.zc.common.zc.publish.IZcXmcgHtServiceDelegate;/** * @author fanpl * */public class ZcEbYanShouBillEditPanel extends AbstractMainSubEditPanel {  private static final long serialVersionUID = -2779110682087878491L;  private static final Logger logger = Logger.getLogger(ZcEbYanShouBillEditPanel.class);  private RequestMeta requestMeta = WorkEnv.getInstance().getRequestMeta();  private String compoId = "ZC_EB_YANSHOU";  private ArrayList<ButtonStatus> btnStatusList = new ArrayList<ButtonStatus>();  private String pageStatus = ZcSettingConstants.PAGE_STATUS_BROWSE;  private FuncButton addButton = new AddButton();  private FuncButton previousButton = new PreviousButton();  private FuncButton saveButton = new SaveButton();  private FuncButton deleteButton = new DeleteButton();  private FuncButton nextButton = new NextButton();  private FuncButton editButton = new EditButton();  private FuncButton exitButton = new ExitButton();  // 工作流送审  private FuncButton sendButton = new SendButton();  // 工作流收回  private FuncButton callbackButton = new CallbackButton();  // 工作流填写意见审核通过  private FuncButton suggestPassButton = new SuggestAuditPassButton();  // 工作流审核通过  private FuncButton auditPassButton = new AuditPassButton();  //是否送主任审核  private FuncButton isSendToNextButton = new IsSendToNextButton();  //工作流终审核通过  private FuncButton auditFinalPassButton = new AuditFinalPassButton();  // 工作流销审  private FuncButton unAuditButton = new UnauditButton();  // 工作流退回  private FuncButton unTreadButton = new UntreadButton();  // 工作流流程跟踪  private FuncButton traceButton = new TraceButton();  //送采购单位确认  private FuncButton sendToProcurementUnitButton = new SendToProcurementUnitButton();  //同意  private FuncButton agreeButton = new AgreeButton();  //不同意  private FuncButton disagreeButton = new DisagreeButton();  //送协办人审核  private FuncButton sendToXieBanButton = new SendToXieBanButton();  private PrintPreviewButton printPreviewButton = new PrintPreviewButton();  private FuncButton printButton = new PrintButton();  private FuncButton providerCheckButton = new ProviderCheckButton();  private FuncButton caigouRenFuncButton = new CaigouRenCheckButton();  private FuncButton organizerCheckButton = new OrganizerCheckButton();  private FuncButton yanshouteamCheckButton = new YanShouTeamCheckButton();  protected ListCursor listCursor;  private ZcEbYanShouBill oldZcEbYanShouBill;  private ZcEbYanShouBillListPanel listPanel;  private ZcEbYanShouBillEditPanel self = this;  private GkBaseDialog parent;  private WordPane wordPane = new WordPane();  private String fileName;  private JTabbedPane jTabbedPane = null;  private JTablePanel detailTablePanel = new JTablePanel();  private JFuncToolBar bottomToolBar1 = null;  private JTextArea providerArea;  private JTextArea caigoRenArea;  private JTextArea yanShouTeamArea;  private JTextArea zuzhiDanweiArea;  private String zcSuOpinion;  private String zcCoOpinion;  private String zcYanShouTeamOpinion;  private String zcOrganizerOpinion;  private DateFieldEditor providerFillDate;  private DateFieldEditor caigoRenFillDate;  private DateFieldEditor yanShouTeamFillDate;  private DateFieldEditor zuzhiDanweiFillDate;  private String angcy;  private String orgCode;  private final ElementConditionDto zbDto = new ElementConditionDto();  private ForeignEntityFieldEditor packNameEntityFieldEditor;  public IZcXmcgHtServiceDelegate zcXmcgHtServiceDelegate = (IZcXmcgHtServiceDelegate) ServiceFactory.create(IZcXmcgHtServiceDelegate.class,  "zcXmcgHtServiceDelegate");  public IBaseDataServiceDelegate baseDataServiceDelegate = (IBaseDataServiceDelegate) ServiceFactory.create(IBaseDataServiceDelegate.class,  "baseDataServiceDelegate");  public IZcEbBaseServiceDelegate zcEbBaseServiceDelegate = (IZcEbBaseServiceDelegate) ServiceFactory.create(IZcEbBaseServiceDelegate.class,  "zcEbBaseServiceDelegate");  public ZcEbYanShouBillEditPanel(GkBaseDialog parent, ListCursor listCursor, String tabStatus, ZcEbYanShouBillListPanel listPanel) {    super(ZcEbYanShouBill.class, listPanel.getBillElementMeta());    this.listCursor = listCursor;    this.listPanel = listPanel;    this.workPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "项目验收单", TitledBorder.CENTER, TitledBorder.TOP,    new Font("宋体", Font.BOLD, 15), Color.BLUE));    this.parent = parent;    this.colCount = 3;    init();    requestMeta.setCompoId(compoId);    refreshMainData();  }  @Override  public List<AbstractFieldEditor> createFieldEditors() {    List<AbstractFieldEditor> editorList = new ArrayList<AbstractFieldEditor>();    AutoNumFieldEditor billCode = new AutoNumFieldEditor("验收单编号", "billCode", false);    //    editorList.add(billCode);    //    TextFieldEditor billName = new TextFieldEditor("验收单名称", "billName");    //    editorList.add(billName);    ElementConditionDto projDto = new ElementConditionDto();    projDto.setNd(requestMeta.getSvNd());    //projDto.setZcText1(requestMeta.getSvUserID());//供应商发起    projDto.setZcText0(requestMeta.getSvCoCode());//采购人发起    zbDto.setNd(requestMeta.getSvNd());    String projColumNames[] = { "采购项目", "采购计划编号" };    ProjSelectedHandler projHandler = new ProjSelectedHandler(projColumNames);    ForeignEntityFieldEditor projCode = new ForeignEntityFieldEditor("ZcEbYanShou.getZcEbProjList", projDto, 10, projHandler, projColumNames,      "采购计划编号",      "projCode");    editorList.add(projCode);    TextFieldEditor projName = new TextFieldEditor("采购项目", "projName");    editorList.add(projName);    String columNames[] = { "合同编号", "验收内容", "中标供应商代码", "中标供应商名称", "供应商联系人" };    ZbSelectedHandler packHandler = new ZbSelectedHandler(columNames);    packNameEntityFieldEditor = new ForeignEntityFieldEditor("ZC_XMCG_HT.selectHTList", zbDto, 10, packHandler, columNames, "验收内容", "packName");    editorList.add(packNameEntityFieldEditor);    CompanyFieldEditor zcCoCode = new CompanyFieldEditor("预算单位", "coCode");    editorList.add(zcCoCode);    TextFieldEditor zcMakeLinkMan = new TextFieldEditor("预算单位联系人", "zcMakeLinkMan");    editorList.add(zcMakeLinkMan);    TextFieldEditor zcMakeLinkManTel = new TextFieldEditor("预算单位联系人电话", "zcMakeLinkManTel");    editorList.add(zcMakeLinkManTel);    TextFieldEditor zcSuName = new TextFieldEditor("供应商", "zcSuName");    editorList.add(zcSuName);    TextFieldEditor zcSuLinkMan = new TextFieldEditor("供应商负责人", "zcSuLinkMan");    editorList.add(zcSuLinkMan);    TextFieldEditor zcSuLinkManTel = new TextFieldEditor("供应商负责人电话", "zcSuLinkManTel");    editorList.add(zcSuLinkManTel);    DateFieldEditor yanShouDate = new DateFieldEditor("制单时间", "billYanShouDate", DateFieldEditor.TimeTypeH24);    editorList.add(yanShouDate);    FileFieldEditor zcImpFile = new FileFieldEditor("项目验收单", "zcImpFile", "zcImpFileBlobid");    editorList.add(zcImpFile);    FileFieldEditor zcinfoFile = new FileFieldEditor("货物清单", "zcInfoFile", "zcInfoFileBlobid");    editorList.add(zcinfoFile);    AsValFieldEditor status = new AsValFieldEditor("状态", "status", "ZC_VS_YANSHOU_BILL_STATUS");    status.setEnabled(false);    editorList.add(status);    return editorList;  }  @Override  public JComponent createSubBillPanel() {    JPanel yijianPanel = new JPanel(new FlowLayout());    JTabbedPane tabbedPane = new JTabbedPane();    //供应商意见    JPanel providerPanel = new JPanel(null);    providerPanel.setLayout(new BorderLayout());    providerPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "供应商意见*", TitledBorder.CENTER, TitledBorder.TOP,    new Font("宋体", Font.BOLD, 12), new Color(154, 70, 100)));    providerArea = new JTextArea();    providerArea.setBackground(Color.WHITE);    //    providerArea.setLayout(null);    //    providerArea.setVisible(true);    providerArea.setLineWrap(true);    providerArea.setEditable(false);    JScrollPane scrollPane1 = new JScrollPane(providerArea);    providerPanel.add(scrollPane1, BorderLayout.CENTER);    scrollPane1.setPreferredSize(new Dimension(180, 200));    JLabel datelabel1 = new JLabel("验收时间*");    datelabel1.setForeground(new Color(254, 70, 1));    datelabel1.setFont(new Font("宋体", Font.BOLD, 12));    providerFillDate = new DateFieldEditor("时间", "providerFillDate", DateField.TimeTypeH24);    providerFillDate.setEditObject(listCursor.getCurrentObject());    providerFillDate.setEnabled(false);    JPanel jp = new JPanel();    jp.setLayout(new FlowLayout());    jp.add(datelabel1);    jp.add(providerFillDate);    providerPanel.add(jp, BorderLayout.SOUTH);    //    yijianPanel.add(providerPanel);    //采购人验收意见    JPanel caigoRenPanel = new JPanel(null);    caigoRenPanel.setLayout(new BorderLayout());    caigoRenPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "验收意见*", TitledBorder.CENTER, TitledBorder.TOP,    new Font("宋体", Font.BOLD, 12), new Color(154, 70, 100)));    caigoRenArea = new JTextArea();    caigoRenArea.setBackground(Color.WHITE);    //    caigoRenArea.setLayout(null);    //    caigoRenArea.setVisible(true);    caigoRenArea.setLineWrap(true);    caigoRenArea.setEditable(false);    JScrollPane scrollPane2 = new JScrollPane(caigoRenArea);    caigoRenPanel.add(scrollPane2, BorderLayout.CENTER);    scrollPane2.setPreferredSize(new Dimension(180, 200));    JLabel datelabel2 = new JLabel("验收时间*");    datelabel2.setForeground(new Color(254, 70, 1));    datelabel2.setFont(new Font("宋体", Font.BOLD, 12));    caigoRenFillDate = new DateFieldEditor("时间", "caigoRenFillDate", DateField.TimeTypeH24);    caigoRenFillDate.setEditObject(listCursor.getCurrentObject());    caigoRenFillDate.setEnabled(false);    jp = new JPanel();    jp.setLayout(new FlowLayout());    jp.add(datelabel2);    jp.add(caigoRenFillDate);    caigoRenPanel.add(jp, BorderLayout.SOUTH);    yijianPanel.add(caigoRenPanel);    //验收小组意见    JPanel yanShouTeamPanel = new JPanel(null);    yanShouTeamPanel.setLayout(new BorderLayout());    yanShouTeamPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "验收成员*", TitledBorder.CENTER, TitledBorder.TOP,    new Font("宋体", Font.BOLD, 12), new Color(154, 70, 100)));    yanShouTeamArea = new JTextArea();    yanShouTeamArea.setBackground(Color.WHITE);    //    yanShouTeamArea.setLayout(null);    //    yanShouTeamArea.setVisible(true);    yanShouTeamArea.setLineWrap(true);    yanShouTeamArea.setEditable(false);    JScrollPane scrollPane3 = new JScrollPane(yanShouTeamArea);    yanShouTeamPanel.add(scrollPane3, BorderLayout.CENTER);    scrollPane3.setPreferredSize(new Dimension(180, 200));    //    scrollPane3.setBounds(100, 40, 600, 100);    //    yanShouTeamPanel.add(scrollPane3);    JLabel datelabel3 = new JLabel("验收时间*");    datelabel3.setForeground(new Color(254, 70, 1));    datelabel3.setFont(new Font("宋体", Font.BOLD, 12));    yanShouTeamFillDate = new DateFieldEditor("时间", "yanShouTeamFillDate", DateField.TimeTypeH24);    yanShouTeamFillDate.setEditObject(listCursor.getCurrentObject());    yanShouTeamFillDate.setEnabled(false);    jp = new JPanel();    jp.setLayout(new FlowLayout());    jp.add(datelabel3);    jp.add(yanShouTeamFillDate);    yanShouTeamPanel.add(jp, BorderLayout.SOUTH);    yijianPanel.add(yanShouTeamPanel);    //组织单位验收意见    JPanel zuzhiPanel = new JPanel(null);    zuzhiPanel.setLayout(new BorderLayout());    zuzhiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "验收负责人*", TitledBorder.CENTER, TitledBorder.TOP,    new Font("宋体", Font.BOLD, 12), new Color(154, 70, 100)));    JLabel datelabel5 = new JLabel("单位签章");    datelabel5.setForeground(new Color(254, 70, 1));    datelabel5.setFont(new Font("宋体", Font.BOLD, 12));    jp = new JPanel();    jp.setLayout(new FlowLayout());    jp.add(datelabel5);    zuzhiPanel.add(jp, BorderLayout.NORTH);    zuzhiDanweiArea = new JTextArea();    zuzhiDanweiArea.setBackground(Color.WHITE);    //    zuzhiDanweiArea.setLayout(null);    //    zuzhiDanweiArea.setVisible(true);    zuzhiDanweiArea.setLineWrap(true);    zuzhiDanweiArea.setEditable(false);    JScrollPane scrollPane4 = new JScrollPane(zuzhiDanweiArea);    zuzhiPanel.add(scrollPane4, BorderLayout.CENTER);    scrollPane4.setPreferredSize(new Dimension(180, 170));    JLabel datelabel4 = new JLabel("验收时间*");    datelabel4.setForeground(new Color(254, 70, 1));    datelabel4.setFont(new Font("宋体", Font.BOLD, 12));    zuzhiDanweiFillDate = new DateFieldEditor("时间", "zuzhiDanweiFillDate", DateField.TimeTypeH24);    zuzhiDanweiFillDate.setEditObject(listCursor.getCurrentObject());    zuzhiDanweiFillDate.setEnabled(false);    jp = new JPanel();    jp.setLayout(new FlowLayout());    jp.add(datelabel4);    jp.add(zuzhiDanweiFillDate);    zuzhiPanel.add(jp, BorderLayout.SOUTH);    yijianPanel.add(zuzhiPanel);    JPanel subMainPanel = new JPanel();    subMainPanel.setLayout(new BorderLayout());    JTabbedPane tbp = new JTabbedPane();    tbp.add("验收意见", yijianPanel);    subMainPanel.add(tbp, BorderLayout.CENTER);    subMainPanel.add(createItemPanel(), BorderLayout.SOUTH);    return subMainPanel;  }  private JTabbedPane createItemPanel() {    jTabbedPane = new JTabbedPane();    detailTablePanel.init();    detailTablePanel.getSearchBar().setVisible(false);    detailTablePanel.setTablePreferencesKey(this.getClass().getName() + "_biTable");    detailTablePanel.getTable().setShowCheckedColumn(true);    detailTablePanel.getTable().getTableRowHeader().setPreferredSize(new Dimension(60, 0));    jTabbedPane.addTab("验收明细", detailTablePanel);    bottomToolBar1 = new JFuncToolBar();    FuncButton addBtn1 = new SubaddButton(false);    FuncButton insertBtn1 = new SubinsertButton(false);    FuncButton delBtn1 = new SubdelButton(false);    //    bottomToolBar1.add(addBtn1);    //    bottomToolBar1.add(insertBtn1);    //    bottomToolBar1.add(delBtn1);    detailTablePanel.add(bottomToolBar1, BorderLayout.SOUTH);    addBtn1.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        ZcEbYanShouBillItem detail = new ZcEbYanShouBillItem();        detail.setTempId(Guid.genID());        setdetailBiDefaultValue(detail);        int rowNum = addSub(detailTablePanel, detail);        detailTablePanel.getTable().setRowSelectionInterval(rowNum, rowNum);      }    });    insertBtn1.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        ZcEbYanShouBillItem detail = new ZcEbYanShouBillItem();        detail.setTempId(Guid.genID());        setdetailBiDefaultValue(detail);        int rowNum = insertSub(detailTablePanel, detail);        detailTablePanel.getTable().setRowSelectionInterval(rowNum, rowNum);      }    });    delBtn1.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        Integer[] checkedRows = deleteSub(detailTablePanel);      }    });    return jTabbedPane;  }  private void setdetailBiDefaultValue(ZcEbYanShouBillItem detail) {    ZcEbYanShouBill bill = (ZcEbYanShouBill) listCursor.getCurrentObject();    detail.setBillCode(bill.getBillCode());  }  private void refreshMainData() {    ZcEbYanShouBill zcEbYanShouBill = (ZcEbYanShouBill) listCursor.getCurrentObject();    if (zcEbYanShouBill == null) {      zcEbYanShouBill = new ZcEbYanShouBill();      zcEbYanShouBill.setStatus("0");      zcEbYanShouBill.setNd(requestMeta.getSvNd());      zcEbYanShouBill.setBillYanShouDate(requestMeta.getSysDate());      pageStatus = ZcSettingConstants.PAGE_STATUS_NEW;      List detailList = new ArrayList();      zcEbYanShouBill.setItemList(detailList);      listCursor.setCurrentObject(zcEbYanShouBill);      listCursor.getDataList().add(zcEbYanShouBill);    }    refreshTextArea();    this.setEditingObject(zcEbYanShouBill);    detailTablePanel.setTableModel(ZcEbYanShouBillToTableModelConverter.convertSubBiTableData(zcEbYanShouBill.getItemList(), null));    // 根据工作流模版设置字段是否可编辑    updateWFEditorEditable(zcEbYanShouBill, requestMeta);    // 翻译从表表头列    ZcUtil.translateColName(detailTablePanel.getTable(), ZcEbYanShouBillToTableModelConverter.getBillDetailInfo());    // 设置从表列类型    setTabledetailEditor(detailTablePanel.getTable());    // 根据工作流模版设置功能按钮是否可用    addItemTableLisenter(detailTablePanel.getTable());    setButtonStatus();    setButtonStatus(zcEbYanShouBill, requestMeta, listCursor);    Long processInstId = zcEbYanShouBill.getProcessInstId();    if (processInstId == null || processInstId.longValue() < 0) {      sendToProcurementUnitButton.setVisible(false);      sendToXieBanButton.setVisible(false);    }    if ("0".equals(zcEbYanShouBill.getStatus()) || caigouRenFuncButton.isVisible()) {      saveButton.setVisible(true);    }    updateFieldEditorsEditable();    updateTableEditable();    setOldObject();    this.fitTable();  }  private void refreshTextArea() {    ZcEbYanShouBill zcEbYanShouBill = (ZcEbYanShouBill) listCursor.getCurrentObject();    if (zcEbYanShouBill.getZcSuOpinion() != null) {      providerArea.setText(zcEbYanShouBill.getZcSuOpinion());      providerFillDate.setEditObject(zcEbYanShouBill);    } else {      providerArea.setText(null);      providerFillDate.setValue(null);    }    if (zcEbYanShouBill.getZcCoOpinion() != null) {      caigoRenArea.setText(zcEbYanShouBill.getZcCoOpinion());      caigoRenFillDate.setEditObject(zcEbYanShouBill);    } else {      caigoRenArea.setText(null);      caigoRenFillDate.setValue(null);    }    if (zcEbYanShouBill.getZcYanShouTeamOpinion() != null) {      yanShouTeamArea.setText(zcEbYanShouBill.getZcYanShouTeamOpinion());      yanShouTeamFillDate.setEditObject(zcEbYanShouBill);    } else {      yanShouTeamArea.setText(null);      yanShouTeamFillDate.setValue(null);    }    if (zcEbYanShouBill.getZcOrganizerOpinion() != null) {      zuzhiDanweiArea.setText(zcEbYanShouBill.getZcOrganizerOpinion());      zuzhiDanweiFillDate.setEditObject(zcEbYanShouBill);    } else {      zuzhiDanweiArea.setText(null);      zuzhiDanweiFillDate.setValue(null);    }  }  private void setTabledetailEditor(JPageableFixedTable table) {    table.setDefaultEditor(String.class, new TextCellEditor());    SwingUtil.setTableCellEditor(table, "FUND_SUM", new MoneyCellEditor(false));    SwingUtil.setTableCellRenderer(table, "FUND_SUM", new NumberCellRenderer());  }  private void setOldObject() {    oldZcEbYanShouBill = (ZcEbYanShouBill) ObjectUtil.deepCopy(listCursor.getCurrentObject());  }  @Override  public void initToolBar(JFuncToolBar toolBar) {    toolBar.setModuleCode("ZC");    toolBar.setCompoId(compoId);    toolBar.add(addButton);    toolBar.add(saveButton);    toolBar.add(editButton);    //    toolBar.add(providerCheckButton);    toolBar.add(caigouRenFuncButton);    toolBar.add(organizerCheckButton);    toolBar.add(yanshouteamCheckButton);    toolBar.add(sendButton);    toolBar.add(suggestPassButton);    toolBar.add(auditPassButton);    toolBar.add(auditFinalPassButton);    toolBar.add(isSendToNextButton);    toolBar.add(sendToProcurementUnitButton);    toolBar.add(agreeButton);    toolBar.add(disagreeButton);    toolBar.add(sendToXieBanButton);    toolBar.add(callbackButton);    toolBar.add(unAuditButton);    toolBar.add(unTreadButton);    toolBar.add(traceButton);    toolBar.add(deleteButton);    toolBar.add(previousButton);    toolBar.add(nextButton);    toolBar.add(printPreviewButton);    toolBar.add(exitButton);    toolBar.add(printButton);    printButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        doPrint();      }    });    addButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 新增        //        doAdd();      }    });    saveButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 保存        doSave();      }    });    deleteButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 删除        doDelete();      }    });    sendButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 送审        doSend();      }    });    editButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 修改        doEdit();      }    });    callbackButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 收回        doCallback();      }    });    suggestPassButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent arg0) {        // 填写意见审核        doSuggestPass();      }    });    auditPassButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 审核        doAuditPass();      }    });    auditFinalPassButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 审核        doAuditFinalPass();      }    });    unAuditButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 销审        doUnaudit();      }    });    unTreadButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 退回        doUntread();      }    });    traceButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 流程跟踪        doTrace();      }    });    previousButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 上一页        doPrevious();      }    });    nextButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 下一页        doNext();      }    });    exitButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 退出        doExit();      }    });    printPreviewButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        doPrintPreview();      }    });    providerCheckButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        doFillOpinion(providerCheckButton);      }    });    caigouRenFuncButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        doFillOpinion(caigouRenFuncButton);      }    });    organizerCheckButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        doFillOpinion(organizerCheckButton);      }    });    yanshouteamCheckButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        doFillOpinion(yanshouteamCheckButton);      }    });    isSendToNextButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 送审        doSendNext();      }    });    sendToProcurementUnitButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 送采购单位确认        doSendToProcurementUnit();      }    });    agreeButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 同意        doAgree();      }    });    disagreeButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 不同意        doDisagree();      }    });    sendToXieBanButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        // 送协办人        doSendToXieBan();      }    });  }  /**   * 送协办人   */  private void doSendToXieBan() {    ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());    requestMeta.setFuncId(this.sendToXieBanButton.getFuncId());    executeAudit(bill, ZcSettingConstants.IS_GOON_AUDIT_NO, null);  }  /**   * 同意   */  private void doAgree() {    ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());    requestMeta.setFuncId(this.agreeButton.getFuncId());    Integer auditFlag = bill.getIsGoonAudit();    auditFlag = auditFlag == null ? 0 : auditFlag;    executeAudit(bill, auditFlag + ZcSettingConstants.IS_GOON_AUDIT_YES, null);  }  /**   * 不同意   */  private void doDisagree() {    ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());    requestMeta.setFuncId(this.disagreeButton.getFuncId());    Integer auditFlag = bill.getIsGoonAudit();    auditFlag = auditFlag == null ? 0 : auditFlag;    executeAudit(bill, auditFlag - ZcSettingConstants.IS_GOON_AUDIT_YES, ZcSettingConstants.AUDIT_DISAGREE_DEFULT_MESSAGE);  }  /*   * 填写意见审核   */  private void doSuggestPass() {    ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());    if (isDataChanged()) {      JOptionPane.showMessageDialog(this, "数据已经发生改变，先保存数据再送审.", "提示", JOptionPane.INFORMATION_MESSAGE);      return;    }    requestMeta.setFuncId(this.suggestPassButton.getFuncId());    String jianShenRoleId = AsOptionMeta.getOptVal("OPT_ZC_CGZX_JSKY_ROLE");//监审组员角色    String ysdwfz = AsOptionMeta.getOptVal(ZcElementConstants.OPT_ZC_YSDWCG_ROLE);    if (WorkEnv.getInstance().containRole(jianShenRoleId)) {//如果是监审员，则不修改审批状态      Integer auditFlag = bill.getIsGoonAudit();      executeAudit(bill, auditFlag, null);    } else if (WorkEnv.getInstance().containRole(ysdwfz)) {//如果是预算单位负责人      doCaiGouCommitFN();    } else {      executeAudit(bill, ZcSettingConstants.IS_GOON_AUDIT_NO, null);    }  }  private void doSendToProcurementUnit() {    if (isDataChanged()) {      JOptionPane.showMessageDialog(this, "数据发生改变，请先保存.", "提示", JOptionPane.INFORMATION_MESSAGE);      return;    }    if (!checkBeforeSave()) {      return;    }    GkCommentDialog commentDialog = new GkCommentDialog(DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(),    ModalityType.APPLICATION_MODAL);    if (commentDialog.cancel) {      return;    }    boolean success = true;    ZcEbYanShouBill afterSaveBill = null;    String errorInfo = "";    try {      requestMeta.setFuncId(this.sendToProcurementUnitButton.getFuncId());      ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());      bill.setComment(commentDialog.getComment());      bill.setAuditorId(WorkEnv.getInstance().getCurrUserId());      bill.setIsGoonAudit(ZcSettingConstants.IS_GOON_AUDIT_YES);      String ysdwfz = AsOptionMeta.getOptVal("AUDIT_YSDW_ROLE_STRING");      String suppplier = AsOptionMeta.getOptVal("OPT_PR_GYS_ROLE_ID");      this.listPanel.getZcEbYanShouBillServiceDelegate().saveZcEbYanShouBillFN(bill, requestMeta);      listPanel.getZcEbYanShouBillServiceDelegate().sendToProcurementUnitFN(bill, requestMeta);      afterSaveBill = this.listPanel.getZcEbYanShouBillServiceDelegate().getZcEbYanShouBill(bill.getBillCode(), requestMeta);    } catch (Exception e) {      success = false;      logger.error(e.getMessage(), e);      errorInfo += e.getMessage();    }    if (success) {      JOptionPane.showMessageDialog(this, "审核成功！", "提示", JOptionPane.INFORMATION_MESSAGE);      this.refreshAll(afterSaveBill, true);      this.listPanel.refreshCurrentTabData();    } else {      JOptionPane.showMessageDialog(this, "审核失败 ！" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE);    }  }  public void doAuditFinalPass() {    if (isDataChanged()) {      JOptionPane.showMessageDialog(this, "数据发生改变，请先保存.", "提示", JOptionPane.INFORMATION_MESSAGE);      return;    }    boolean success = true;    ZcEbProtocol afterSaveProtocol = null;    String errorInfo = "";    try {      requestMeta.setFuncId(this.auditFinalPassButton.getFuncId());      ZcEbYanShouBill bill = (ZcEbYanShouBill) this.listCursor.getCurrentObject();      bill.setAuditorId(WorkEnv.getInstance().getCurrUserId());      executeAudit(bill, ZcSettingConstants.IS_GOON_AUDIT_YES, null);      //afterSaveProtocol = listPanel.getZcEbProtocolServiceDelegate().auditFN(protocol, requestMeta);    } catch (Exception e) {      success = false;      logger.error(e.getMessage(), e);      errorInfo += e.getMessage();    }  }  public void refreshData() {    stopTableEditing();    //设置意见框不可编辑    if (pageStatus.equals(ZcSettingConstants.PAGE_STATUS_BROWSE)) {      providerArea.setEditable(false);      providerFillDate.setEnabled(false);      caigoRenArea.setEditable(false);      caigoRenFillDate.setEnabled(false);      zuzhiDanweiArea.setEditable(false);      zuzhiDanweiFillDate.setEnabled(false);      yanShouTeamArea.setEditable(false);      yanShouTeamFillDate.setEnabled(false);    }    refreshMainData();  }  private void notEdit() {    stopTableEditing();    //设置意见框不可编辑    if (pageStatus.equals(ZcSettingConstants.PAGE_STATUS_BROWSE)) {      providerArea.setEditable(false);      providerFillDate.setEnabled(false);      caigoRenArea.setEditable(false);      caigoRenFillDate.setEnabled(false);      zuzhiDanweiArea.setEditable(false);      zuzhiDanweiFillDate.setEnabled(false);      yanShouTeamArea.setEditable(false);      yanShouTeamFillDate.setEnabled(false);    }  }  private void refreshAll(ZcEbYanShouBill afterSaveBill, boolean isRefreshButton) {    this.listCursor.setCurrentObject(afterSaveBill);    pageStatus = ZcSettingConstants.PAGE_STATUS_BROWSE;    refreshData();    if (isRefreshButton) {      setButtonStatus(afterSaveBill, requestMeta, this.listCursor);    }    if ("0".equals(afterSaveBill.getStatus()) || caigouRenFuncButton.isVisible()) {      saveButton.setVisible(true);    }  }  public void doEdit() {    this.pageStatus = ZcSettingConstants.PAGE_STATUS_EDIT;    updateFieldEditorsEditable();    updateTableEditable();    setButtonStatus();  }  /*   * 流程跟踪   */  private void doTrace() {    ZcBaseBill bean = (ZcBaseBill) this.listCursor.getCurrentObject();    if (bean == null) {      return;    }    ZcUtil.showTraceDialog(bean, compoId);  }  /*   * 送审   */  private void doSend() {    boolean success = true;    ZcEbYanShouBill afterSaveBill = null;    String errorInfo = "";    if (isDataChanged()) {      JOptionPane.showMessageDialog(this, "数据已经发生改变，先保存数据再送审.", "提示", JOptionPane.INFORMATION_MESSAGE);      return;    }    if (!checkBeforeSave()) {      return;    }    GkCommentDialog commentDialog = new GkCommentDialog(DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(),    ModalityType.APPLICATION_MODAL);    if (commentDialog.cancel) {      return;    }    try {      requestMeta.setFuncId(this.sendButton.getFuncId());      ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());      bill.setAuditorId(WorkEnv.getInstance().getCurrUserId());      bill.setComment(commentDialog.getComment());      //this.listPanel.getZcEbYanShouBillServiceDelegate().providerNewCommitFN(bill, requestMeta);//供应商发起      this.listPanel.getZcEbYanShouBillServiceDelegate().newCommitFN(bill, requestMeta);//采购单位发起      afterSaveBill = this.listPanel.getZcEbYanShouBillServiceDelegate().getZcEbYanShouBill(bill.getBillCode(), requestMeta);    } catch (Exception ex) {      errorInfo += ex.getMessage();      logger.error(ex.getMessage(), ex);      success = false;      UIUtilities.showStaickTraceDialog(ex, this, "错误", ex.getMessage());    }    if (success) {      JOptionPane.showMessageDialog(this, "送审成功！", "提示", JOptionPane.INFORMATION_MESSAGE);      this.refreshAll(afterSaveBill, true);      this.listPanel.refreshCurrentTabData();    }  }  /*   * 收回   */  private void doCallback() {    boolean success = true;    ZcEbYanShouBill afterSaveBill = null;    String errorInfo = "";    try {      requestMeta.setFuncId(this.callbackButton.getFuncId());      ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());      bill.setAuditorId(WorkEnv.getInstance().getCurrUserId());      bill.setIsGoonAudit(ZcSettingConstants.IS_GOON_AUDIT_NO);      listPanel.getZcEbYanShouBillServiceDelegate().saveZcEbYanShouBillFN(bill, requestMeta);      listPanel.getZcEbYanShouBillServiceDelegate().callbackFN(bill, requestMeta);      afterSaveBill = this.listPanel.getZcEbYanShouBillServiceDelegate().getZcEbYanShouBill(bill.getBillCode(), requestMeta);    } catch (Exception e) {      success = false;      logger.error(e.getMessage(), e);      errorInfo += e.getMessage();    }    if (success) {      JOptionPane.showMessageDialog(this, "收回成功！", "提示", JOptionPane.INFORMATION_MESSAGE);      this.refreshAll(afterSaveBill, true);      this.listPanel.refreshCurrentTabData();    } else {      JOptionPane.showMessageDialog(this, "收回失败 ！" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE);    }  }  /*   * 采购单位负责人。填写意见审核   */  private void doCaiGouCommitFN() {    if (isDataChanged()) {      JOptionPane.showMessageDialog(this, "数据发生改变，请先保存.", "提示", JOptionPane.INFORMATION_MESSAGE);      return;    }    if (!checkBeforeSave()) {      return;    }    GkCommentDialog commentDialog = new GkCommentDialog(DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(),    ModalityType.APPLICATION_MODAL);    if (commentDialog.cancel) {      return;    }    boolean success = true;    ZcEbYanShouBill afterSaveBill = null;    String errorInfo = "";    try {      requestMeta.setFuncId(this.suggestPassButton.getFuncId());      ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());      bill.setComment(commentDialog.getComment());      bill.setAuditorId(WorkEnv.getInstance().getCurrUserId());      bill.setIsGoonAudit(ZcSettingConstants.IS_GOON_AUDIT_NO);      //String ysdwfz = AsOptionMeta.getOptVal("AUDIT_YSDW_ROLE_STRING");      //String suppplier = AsOptionMeta.getOptVal("OPT_PR_GYS_ROLE_ID");      this.listPanel.getZcEbYanShouBillServiceDelegate().saveZcEbYanShouBillFN(bill, requestMeta);      //if (requestMeta.getSvRoleId().equalsIgnoreCase(ysdwfz)) {      listPanel.getZcEbYanShouBillServiceDelegate().CaiGouCommitFN(bill, requestMeta);      // } else if (suppplier.indexOf(requestMeta.getSvRoleId()) != -1) {//供应商暂时在流程中取消      //listPanel.getZcEbYanShouBillServiceDelegate().providerAuditFN(bill, requestMeta);      //      } else {      //        listPanel.getZcEbYanShouBillServiceDelegate().auditFN(bill, requestMeta);      //      }      afterSaveBill = this.listPanel.getZcEbYanShouBillServiceDelegate().getZcEbYanShouBill(bill.getBillCode(), requestMeta);    } catch (Exception e) {      success = false;      logger.error(e.getMessage(), e);      errorInfo += e.getMessage();    }    if (success) {      JOptionPane.showMessageDialog(this, "审核成功！", "提示", JOptionPane.INFORMATION_MESSAGE);      this.refreshAll(afterSaveBill, true);      this.listPanel.refreshCurrentTabData();    } else {      JOptionPane.showMessageDialog(this, "审核失败 ！" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE);    }  }  /*   * 审核通过   */  private void doAuditPass() {    if (!checkBeforeSave()) {      return;    }    if (isDataChanged()) {      JOptionPane.showMessageDialog(this, "数据发生改变，请先保存.", "提示", JOptionPane.INFORMATION_MESSAGE);      return;    }    ZcEbYanShouBill bill = (ZcEbYanShouBill) this.listCursor.getCurrentObject();    executeAudit(bill, ZcSettingConstants.IS_GOON_AUDIT_NO, null);  }  /*   * 销审   */  private void doUnaudit() {    boolean success = true;    ZcEbYanShouBill afterSaveBill = null;    String errorInfo = "";    int i = JOptionPane.showConfirmDialog(this, "是否确定消审？", "确认", JOptionPane.INFORMATION_MESSAGE);    if (i != 0) {      return;    }    try {      requestMeta.setFuncId(unAuditButton.getFuncId());      ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());      bill.setAuditorId(WorkEnv.getInstance().getCurrUserId());      listPanel.getZcEbYanShouBillServiceDelegate().unAuditFN(bill, requestMeta);      afterSaveBill = this.listPanel.getZcEbYanShouBillServiceDelegate().getZcEbYanShouBill(bill.getBillCode(), requestMeta);    } catch (Exception e) {      success = false;      logger.error(e.getMessage(), e);      errorInfo += e.getMessage();    }    if (success) {      JOptionPane.showMessageDialog(this, "销审成功！", "提示", JOptionPane.INFORMATION_MESSAGE);      this.refreshAll(afterSaveBill, true);      this.listPanel.refreshCurrentTabData();      unAuditButton.setVisible(false);    } else {      JOptionPane.showMessageDialog(this, "销审失败 ！" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE);    }  }  private void doSendNext() {    if (isDataChanged()) {      JOptionPane.showMessageDialog(this, "数据发生改变，请先保存.", "提示", JOptionPane.INFORMATION_MESSAGE);      return;    }    ZcEbYanShouBill bill = (ZcEbYanShouBill) this.listCursor.getCurrentObject();    requestMeta.setFuncId(this.isSendToNextButton.getFuncId());    executeAudit(bill, ZcSettingConstants.IS_GOON_AUDIT_YES, null);  }  private void executeAudit(ZcEbYanShouBill bill, int isGoonAudit, String defaultMsg) {    ZcEbYanShouBill afterSaveBill = null;    GkCommentDialog commentDialog = null;    if (defaultMsg == null) {      commentDialog = new GkCommentDialog(DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(),      ModalityType.APPLICATION_MODAL);    } else {      commentDialog = new GkCommentDialog(DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(),      ModalityType.APPLICATION_MODAL, defaultMsg);    }    if (commentDialog.cancel) {      return;    }    boolean success = true;    String errorInfo = "";    try {      bill.setIsGoonAudit(isGoonAudit);      bill.setComment(commentDialog.getComment());      bill.setAuditorId(WorkEnv.getInstance().getCurrUserId());      listPanel.getZcEbYanShouBillServiceDelegate().saveZcEbYanShouBillFN(bill, requestMeta);      listPanel.getZcEbYanShouBillServiceDelegate().auditFN(bill, requestMeta);      afterSaveBill = this.listPanel.getZcEbYanShouBillServiceDelegate().getZcEbYanShouBill(bill.getBillCode(), requestMeta);    } catch (Exception e) {      success = false;      logger.error(e.getMessage(), e);      errorInfo += e.getMessage();    }    if (success) {      JOptionPane.showMessageDialog(this, "审核成功！", "提示", JOptionPane.INFORMATION_MESSAGE);      this.refreshAll(afterSaveBill, true);      this.listPanel.refreshCurrentTabData();      //      unAuditButton.setVisible(true);    } else {      JOptionPane.showMessageDialog(this, "审核失败 ！" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE);    }  }  /*   * 退回   */  private void doUntread() {    if (!checkBeforeSave()) {      return;    }    if (isDataChanged()) {      JOptionPane.showMessageDialog(this, "数据发生改变，请先保存.", "提示", JOptionPane.INFORMATION_MESSAGE);      return;    }    GkCommentUntreadDialog commentDialog = new GkCommentUntreadDialog(DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(),    ModalityType.APPLICATION_MODAL);    if (commentDialog.cancel) {      return;    }    boolean success = true;    ZcEbYanShouBill afterSaveBill = null;    String errorInfo = "";    try {      requestMeta.setFuncId(unTreadButton.getFuncId());      ZcEbYanShouBill bill = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());      bill.setAuditorId(WorkEnv.getInstance().getCurrUserId());      bill.setComment(commentDialog.getComment());      bill.setIsGoonAudit(ZcSettingConstants.IS_GOON_AUDIT_NO);      listPanel.getZcEbYanShouBillServiceDelegate().saveZcEbYanShouBillFN(bill, requestMeta);      listPanel.getZcEbYanShouBillServiceDelegate().untreadFN(bill, requestMeta);      afterSaveBill = this.listPanel.getZcEbYanShouBillServiceDelegate().getZcEbYanShouBill(bill.getBillCode(), requestMeta);    } catch (Exception e) {      success = false;      logger.error(e.getMessage(), e);      errorInfo += e.getMessage();    }    if (success) {      JOptionPane.showMessageDialog(this, "退回成功！", "提示", JOptionPane.INFORMATION_MESSAGE);      this.refreshAll(afterSaveBill, true);      this.listPanel.refreshCurrentTabData();    } else {      JOptionPane.showMessageDialog(this, "退回失败 ！" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE);    }  }  private void doPrevious() {    if (isDataChanged()) {      int num = JOptionPane.showConfirmDialog(this, "当前页面数据已修改，是否要保存", "保存确认", 0);      if (num == JOptionPane.YES_OPTION) {        if (!doSave()) {          return;        }      } else {        listCursor.setCurrentObject(oldZcEbYanShouBill);      }    }    listCursor.previous();    refreshData();  }  private void doNext() {    if (isDataChanged()) {      int num = JOptionPane.showConfirmDialog(this, "当前页面数据已修改，是否要保存", "保存确认", 0);      if (num == JOptionPane.YES_OPTION) {        if (!doSave()) {          return;        }      } else {        listCursor.setCurrentObject(oldZcEbYanShouBill);      }    }    listCursor.next();    refreshData();  }  public boolean doExit() {    if (isDataChanged()) {      int num = JOptionPane.showConfirmDialog(this, "当前页面数据已修改，是否要保存", "保存确认", 0);      if (num == JOptionPane.YES_OPTION) {        if (!doSave()) {          return false;        }      }    }    parent.dispose();    return true;  }  /**   * 保存前校验   * @param cpApply   * @return   */  private boolean checkBeforeSave() {    stopTableEditing();    StringBuffer errStr = new StringBuffer();    ZcEbYanShouBill bill = (ZcEbYanShouBill) listCursor.getCurrentObject();    List mainNotNullList = ((BillElementMeta) this.listPanel.getBillElementMeta()).getNotNullBillElement();    String mainValidateInfo = ZcUtil.validateBillElementNull(bill, mainNotNullList);    if (mainValidateInfo.length() != 0) {      JOptionPane.showMessageDialog(this, mainValidateInfo.toString(), "错误", JOptionPane.ERROR_MESSAGE);      return false;    }    //    //    if (bill.getProjCode() == null || "".equals(bill.getProjCode())) {    //    //      errStr.append("<html><b><font size='3' color='red'>项目编号没有填写</font></b></html>\n");    //    //    }    //    //    if (bill.getPackName() == null || "".equals(bill.getPackName())) {    //    //      errStr.append("<html><b><font size='3' color='red'>验收内容没有填写</font></b></html>\n");    //    //    }    if (caigouRenFuncButton.isVisible()) {      if (bill.getZcCoOpinion() == null || "".equals(bill.getZcCoOpinion().trim())) {        errStr.append("<html><b><font size='3' color='red'>采购人意见没有填写</font></b></html>\n");      }    }    Date date3 = null;    Date date4 = null;    date3 = (Date) yanShouTeamFillDate.getValue();    date4 = (Date) zuzhiDanweiFillDate.getValue();    if (organizerCheckButton.isVisible()) {      if (bill.getZcOrganizerOpinion() == null || "".equals(bill.getZcOrganizerOpinion().trim())) {        errStr.append("<html><b><font size='3' color='red'>验收负责人意见没有填写</font></b></html>\n");      }      if (date4 == null) {        errStr.append("<html><b><font size='3' color='red'>验收负责人验收时间没有填写</font></b></html>\n");      }    }    if (caigouRenFuncButton.isVisible() || yanshouteamCheckButton.isVisible()) {      if (bill.getZcYanShouTeamOpinion() == null || "".equals(bill.getZcYanShouTeamOpinion().trim())) {        errStr.append("<html><b><font size='3' color='red'>验收成员意见没有填写</font></b></html>\n");      }      if (date3 == null) {        errStr.append("<html><b><font size='3' color='red'>验收成员验收时间没有填写</font></b></html>\n");      }    }    if (bill.getZcMakeLinkMan() == null || "".equals(bill.getZcMakeLinkMan())) {      errStr.append("<html><b><font size='3' color='red'>采购单位联系人没有填写</font></b></html>\n");    }    if (bill.getZcSuLinkMan() == null || "".equals(bill.getZcSuLinkMan())) {      errStr.append("<html><b><font size='3' color='red'>供应商联系人没有填写</font></b></html>\n");    }    if (providerArea.getText() != null && providerArea.getText().toCharArray().length > 2000) {      errStr.append("<html><b><font size='3' color='red'>供应商意见字段当前为字符长度为" + providerArea.getText().toCharArray().length      + ",请控制在2000个字符以内</font></b></html>\n");    }    if (caigoRenArea.getText() != null && caigoRenArea.getText().toCharArray().length > 2000) {      errStr.append("<html><b><font size='3' color='red'>采购人意见字段当前为字符长度为" + caigoRenArea.getText().toCharArray().length      + ",请控制在2000个字符以内</font></b></html>\n");    }    if (yanShouTeamArea.getText() != null && yanShouTeamArea.getText().toCharArray().length > 2000) {      errStr.append("<html><b><font size='3' color='red'>验收成员意见字段当前为字符长度为" + yanShouTeamArea.getText().toCharArray().length      + ",请控制在2000个字符以内</font></b></html>\n");    }    if (zuzhiDanweiArea.getText() != null && zuzhiDanweiArea.getText().toCharArray().length > 2000) {      errStr.append("<html><b><font size='3' color='red'>验收负责人意见字段当前为字符长度为" + zuzhiDanweiArea.getText().toCharArray().length      + ",请控制在2000个字符以内</font></b></html>\n");    }    /**     * 验收明细采购人来填写     */    String ysdwcg = AsOptionMeta.getOptVal(ZcElementConstants.OPT_ZC_YSDWCG_ROLE);    if (WorkEnv.getInstance().containRole(ysdwcg)) {      for (int i = 0; i < bill.getItemList().size(); i++) {        ZcEbYanShouBillItem item = (ZcEbYanShouBillItem) bill.getItemList().get(i);        if (item.getShiShouNum() == null) {          errStr.append("<html><b><font size='3' color='red'>产品:[" + item.getProductName() + "]实收数量没有填写</font></b></html>\n");        }        //        if (item.getZhifuAmount() == null) {        //        //          errStr.append("<html><b><font size='3' color='red'>产品:[" + item.getProductName() + "]实际支付金额没有填写</font></b></html>\n");        //        //        }      }    }    Date date2 = null;    date2 = (Date) caigoRenFillDate.getValue();    if (date2 == null) {      errStr.append("<html><b><font size='3' color='red'>采购人验收时间没有填写</font></b></html>\n");    }    if (date2 != null) {      Date d = new Date();      if (date2.after(d)) {        errStr.append("<html><b><font size='3' color='red'>采购人验收时间不能晚于当前时间</font></b></html>\n");      }      if (date3 != null && date3.after(d)) {        errStr.append("<html><b><font size='3' color='red'>验收成员验收时间不能晚于当前时间</font></b></html>\n");      }      if (date4 != null && date4.after(d)) {        errStr.append("<html><b><font size='3' color='red'>验收负责人验收时间不能晚于当前时间</font></b></html>\n");      }    }    if (errStr.toString().length() > 0) {      errStr.append("");      JOptionPane.showMessageDialog(this, errStr.toString(), "提示", JOptionPane.ERROR_MESSAGE);      return false;    }    return true;  }  public void stopTableEditing() {    JPageableFixedTable biTable = this.detailTablePanel.getTable();    if (biTable.isEditing()) {      biTable.getCellEditor().stopCellEditing();    }  }  private void doFillOpinion(FuncButton button) {    if (button instanceof ProviderCheckButton) {      providerArea.setEditable(true);      providerArea.requestFocus();      providerFillDate.setEnabled(true);    } else if (button instanceof CaigouRenCheckButton) {      caigoRenArea.setEditable(true);      caigoRenFillDate.setEnabled(true);      zuzhiDanweiArea.setEditable(true);      zuzhiDanweiFillDate.setEnabled(true);      yanShouTeamArea.setEditable(true);      yanShouTeamFillDate.setEnabled(true);    } else if (button instanceof OrganizerCheckButton) {      zuzhiDanweiArea.setEditable(true);      zuzhiDanweiArea.requestFocus();      zuzhiDanweiFillDate.setEnabled(true);    } else if (button instanceof YanShouTeamCheckButton) {      yanShouTeamArea.setEditable(true);      yanShouTeamArea.requestFocus();      yanShouTeamFillDate.setEnabled(true);    }    this.pageStatus = ZcSettingConstants.PAGE_STATUS_EDIT;    //    updateFieldEditorsEditable();    updateTableEditable();    setButtonStatus();  }  private void doPrint() {    ZcEbYanShouBill zcEbYanShouBill = (ZcEbYanShouBill) this.listCursor.getCurrentObject();    this.requestMeta.setFuncId(this.printPreviewButton.getFuncId());    this.requestMeta.setPageType(this.compoId + "_L");    try {      String billCode = zcEbYanShouBill.getBillCode();      String condition = " t.BILL_CODE='" + billCode + "'";      //      PrintUtilities.print(compoId, "mainTable_L", compoId, "A4", "sa", "", com.ufgov.client.basis.util.WorkEnv.getInstance(), "", condition, null,      //        null, false);    } catch (Exception e) {      logger.error(e.getMessage(), e);      JOptionPane.showMessageDialog(this, "打印预览出错！\n" + e.getMessage(), "错误", 0);    }  }  public boolean doSave() {    if (!isDataChanged()) {      if (!checkBeforeSave()) {        return false;      }      pageStatus = ZcSettingConstants.PAGE_STATUS_BROWSE;      //      JOptionPane.showMessageDialog(this, "数据没有发生改变，不用保存.", "提示", JOptionPane.INFORMATION_MESSAGE);      JOptionPane.showMessageDialog(this, "保存成功！", "提示", JOptionPane.INFORMATION_MESSAGE);      notEdit();      setButtonStatus();      return true;    }    if (!checkBeforeSave()) {      return false;    }    boolean success = true;    ZcEbYanShouBill zcEbYanShouBill = new ZcEbYanShouBill();    String errorInfo = "";    try {      requestMeta.setFuncId(saveButton.getFuncId());      ZcEbYanShouBill inData = (ZcEbYanShouBill) ObjectUtil.deepCopy(this.listCursor.getCurrentObject());      inData.setAgency(angcy);      inData.setOrgCode(orgCode);      zcEbYanShouBill = this.listPanel.getZcEbYanShouBillServiceDelegate().saveZcEbYanShouBillFN(inData, requestMeta);    } catch (Exception e) {      logger.error(e.getMessage(), e);      success = false;      errorInfo += e.getMessage();    }    if (success) {      JOptionPane.showMessageDialog(this, "保存成功！", "提示", JOptionPane.INFORMATION_MESSAGE);      refreshAll(zcEbYanShouBill, true);      this.setOldObject();      this.listPanel.refreshCurrentTabData();    } else {      JOptionPane.showMessageDialog(this, "保存失败 ！\n" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE);    }    return true;  }  protected void doDelete() {    int num = JOptionPane.showConfirmDialog(this, "是否删除当前单据", "删除确认", 0);    if (num == JOptionPane.YES_OPTION) {      boolean success = true;      ZcEbYanShouBill zcEbYanShouBill = null;      String errorInfo = "";      try {        requestMeta.setFuncId(deleteButton.getFuncId());        zcEbYanShouBill = (ZcEbYanShouBill) this.listCursor.getCurrentObject();        if (!"0".equals(zcEbYanShouBill.getStatus()))          JOptionPane.showMessageDialog(this, "非编辑状态单据，不可以删除！", "提示", JOptionPane.ERROR_MESSAGE);        this.listPanel.getZcEbYanShouBillServiceDelegate().deleteZcEbYanShouBillFN(zcEbYanShouBill, requestMeta);      } catch (Exception e) {        logger.error(e.getMessage(), e);        success = false;        errorInfo += e.getMessage();      }      if (success) {        JOptionPane.showMessageDialog(this, "删除成功！", "提示", JOptionPane.INFORMATION_MESSAGE);        this.listCursor.removeCurrentObject();        refreshData();        this.listPanel.refreshCurrentTabData();      } else {        JOptionPane.showMessageDialog(this, "保存失败 ！\n" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE);      }    }  }  private void doPrintPreview() {    ZcEbYanShouBill zcEbYanShouBill = (ZcEbYanShouBill) this.listCursor.getCurrentObject();    this.requestMeta.setFuncId(this.printPreviewButton.getFuncId());    this.requestMeta.setPageType(this.compoId + "_L");    try {      String billCode = zcEbYanShouBill.getBillCode();      String url = WorkEnv.getInstance().getWebRoot() + "app/page/yanshouBill/toYanShouBillPrint.do?billCode=" + billCode;      ZcUtil.anyBrowse(url);    } catch (Exception e) {      logger.error(e.getMessage(), e);      JOptionPane.showMessageDialog(this, "打印预览出错！\n" + e.getMessage(), "错误", 0);    }  }  private void setButtonStatus() {    if (this.btnStatusList.size() == 0) {      ButtonStatus bs = new ButtonStatus();      bs = new ButtonStatus();      bs.setButton(this.editButton);      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_BROWSE);      btnStatusList.add(bs);      bs = new ButtonStatus();      bs.setButton(this.saveButton);      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_EDIT);      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_NEW);      bs.addBillStatus(ZcSettingConstants.BILL_STATUS_ALL);      btnStatusList.add(bs);      bs = new ButtonStatus();      bs.setButton(this.deleteButton);      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_BROWSE);      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_EDIT);      //      bs.addBillStatus("0");      btnStatusList.add(bs);      bs = new ButtonStatus();      bs.setButton(this.sendButton);      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_BROWSE);      //      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_EDIT);      //      bs.addBillStatus("0");      btnStatusList.add(bs);      bs = new ButtonStatus();      bs.setButton(this.previousButton);      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_BROWSE);      bs.addBillStatus(ZcSettingConstants.BILL_STATUS_ALL);      btnStatusList.add(bs);      bs = new ButtonStatus();      bs.setButton(this.printButton);      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_BROWSE);      bs.addBillStatus(ZcSettingConstants.BILL_STATUS_ALL);      btnStatusList.add(bs);      bs = new ButtonStatus();      bs.setButton(this.nextButton);      bs.addPageStatus(ZcSettingConstants.PAGE_STATUS_BROWSE);      bs.addBillStatus(ZcSettingConstants.BILL_STATUS_ALL);      btnStatusList.add(bs);    }    ZcEbYanShouBill obj = (ZcEbYanShouBill) this.listCursor.getCurrentObject();    String billStatus = obj.getStatus();    ZcUtil.setButtonEnable(this.btnStatusList, billStatus, this.pageStatus, this.compoId, obj.getProcessInstId());  }  @Override  protected void updateFieldEditorsEditable() {    super.updateFieldEditors();    if (this.pageStatus.equals(ZcSettingConstants.PAGE_STATUS_NEW) || this.pageStatus.equals(ZcSettingConstants.PAGE_STATUS_EDIT)) {      for (AbstractFieldEditor fd : this.fieldEditors) {        if ("billCode".equals(fd.getFieldName()) || "zcCoCode".equals(fd.getFieldName()) || "zcSuName".equals(fd.getFieldName())        || "projName".equals(fd.getFieldName()) || "status".equals(fd.getFieldName()) || "yanShouDate".equals(fd.getFieldName())          || "coCode".equals(fd.getFieldName()) || "zcMakeLinkMan".equals(fd.getFieldName()) || "zcMakeLinkManTel".equals(fd.getFieldName())) {          fd.setEnabled(false);        } else {          fd.setEnabled(true);        }      }    }  }  public void addItemTableLisenter(final JPageableFixedTable table) {    final BeanTableModel model = (BeanTableModel) table.getModel();    model.addTableModelListener(new TableModelListener() {      public void tableChanged(TableModelEvent e) {        if (e.getType() == TableModelEvent.UPDATE) {          if (e.getColumn() >= 0          && ("".equals(model.getColumnIdentifier(e.getColumn())) || "SHISHOU_NUM".equals(model.getColumnIdentifier(e.getColumn())) || "ZHIFU_AMOUNT"          .equals(model.getColumnIdentifier(e.getColumn())))) {            int k = table.getSelectedRow();            if (k < 0)              return;            ZcEbYanShouBillItem item = (ZcEbYanShouBillItem) model.getBean(table.convertRowIndexToModel(k));            BigDecimal shiShouNum = item.getShiShouNum();            BigDecimal zhifuAmount = item.getZhifuAmount();            BigDecimal htAmount = item.getHtAmount();            BigDecimal htNum = item.getHtNum();            if (shiShouNum != null && htNum != null) {              item.setPianChaNum(htNum.subtract(shiShouNum));            }            if (zhifuAmount != null && htAmount != null) {              item.setPianChaAmount(htAmount.subtract(zhifuAmount));            }            model.fireTableRowsUpdated(k, k);          }        }      }    });  }  private void updateTableEditable() {    if (this.pageStatus.equals(ZcSettingConstants.PAGE_STATUS_NEW) || this.pageStatus.equals(ZcSettingConstants.PAGE_STATUS_EDIT)) {      detailTablePanel.getTable().setEnabled(true);    } else if (this.pageStatus.equals(ZcSettingConstants.PAGE_STATUS_BROWSE)) {      detailTablePanel.getTable().setEnabled(false);    }  }  @Override  protected void updateWFSubTableEditable() {    ZcEbYanShouBill currentBill = (ZcEbYanShouBill) listCursor.getCurrentObject();    detailTablePanel.setTableModel(ZcEbYanShouBillToTableModelConverter.convertSubBiTableData(currentBill.getItemList(), wfCanEditFieldMap));  }  public boolean isDataChanged() {    ZcEbYanShouBill currentBill = (ZcEbYanShouBill) listCursor.getCurrentObject();    zcSuOpinion = providerArea.getText();    zcCoOpinion = caigoRenArea.getText();    zcYanShouTeamOpinion = yanShouTeamArea.getText();    zcOrganizerOpinion = zuzhiDanweiArea.getText();    if (zcSuOpinion != null && !"".equals(zcSuOpinion)) {      currentBill.setZcSuOpinion(zcSuOpinion);    }    if (zcCoOpinion != null && !"".equals(zcCoOpinion)) {      currentBill.setZcCoOpinion(zcCoOpinion);    }    if (zcYanShouTeamOpinion != null && !"".equals(zcYanShouTeamOpinion)) {      currentBill.setZcYanShouTeamOpinion(zcYanShouTeamOpinion);    }    if (zcOrganizerOpinion != null && !"".equals(zcOrganizerOpinion)) {      currentBill.setZcOrganizerOpinion(zcOrganizerOpinion);    }    if (providerFillDate.getValue() != null) {      currentBill.setProviderFillDate((Date) providerFillDate.getValue());    }    if (caigoRenFillDate.getValue() != null) {      currentBill.setCaigoRenFillDate((Date) caigoRenFillDate.getValue());    }    if (yanShouTeamFillDate.getValue() != null) {      currentBill.setYanShouTeamFillDate((Date) yanShouTeamFillDate.getValue());    }    if (zuzhiDanweiFillDate.getValue() != null) {      currentBill.setZuzhiDanweiFillDate((Date) zuzhiDanweiFillDate.getValue());    }    return !DigestUtil.digest(oldZcEbYanShouBill).equals(DigestUtil.digest(currentBill));  }  /**   *    * 获得该项目的标段信息   */  private class ZbSelectedHandler implements IForeignEntityHandler {    private final String columNames[];    public ZbSelectedHandler(String columNames[]) {      this.columNames = columNames;    }    /*     * 设置外部实体数据条件     */    public Boolean beforeSelect(ElementConditionDto dto) {      ZcEbYanShouBill bill = (ZcEbYanShouBill) listCursor.getCurrentObject();      if (null == bill.getProjCode()) {        JOptionPane.showMessageDialog(self, "请先选择一个采购项目 ！", "提示", JOptionPane.INFORMATION_MESSAGE);        return false;      }      return true;    }    /*     * 清空外部实体对应的数据     */    public void afterClear() {      ZcEbYanShouBill bill = (ZcEbYanShouBill) listCursor.getCurrentObject();      bill.setZcSuLinkMan(null);      bill.setZcSuCode(null);      bill.setZcSuName(null);      bill.setZcSuLinkMan(null);      bill.setZcSuLinkManTel(null);      List detailList = new ArrayList();      bill.setItemList(detailList);      bill.setZcMakeLinkMan(null);      bill.setZcMakeLinkManTel(null);      bill.setPackName(null);      bill.setCoCode(null);      bill.setCoName(null);      refreshData();      setEditingObject(bill);      return;    }    public void excute(List selectedDatas) {      ZcEbYanShouBill bill = (ZcEbYanShouBill) listCursor.getCurrentObject();      for (Object object : selectedDatas) {        ZcXmcgHt ht = (ZcXmcgHt) object;        List<ZcTBchtItem> htItemList = zcXmcgHtServiceDelegate.selectByPrimaryKey(ht.getZcHtCode(), requestMeta).getItemList();        List<ZcEbYanShouBillItem> billItemList = new ArrayList(htItemList.size());        for (int i = 0; i < htItemList.size(); i++) {          ZcTBchtItem htItem = htItemList.get(i);          ZcEbYanShouBillItem billItem = new ZcEbYanShouBillItem();          billItem.setHtAmount(htItem.getZcItemVal());          billItem.setHtNum(htItem.getZcCaigShl());          billItem.setProductName(htItem.getZcSpName());          billItem.setProductParam(htItem.getZcMerSpec());          billItemList.add(billItem);        }        bill.setPackName(ht.getZcHtName());        bill.setCoCode(ht.getCoCode());        if (!"".equals(bill.getCoCode()) && bill.getCoCode() != null) {          bill.setCoName(baseDataServiceDelegate.getCompanyByCoCode(requestMeta.getSvNd(), bill.getCoCode(), requestMeta).getName());        }        bill.setPackCode(ht.getZcBidCode());        if (!"".equals(bill.getPackCode()) && bill.getPackCode() != null) {          ElementConditionDto dto = new ElementConditionDto();          dto.setPackCode(bill.getPackCode());          List list = zcEbBaseServiceDelegate.getForeignEntitySelectedData("ZcEbYanShou.getZcPProMakeList", dto, requestMeta);          if (list != null && list.size() > 0) {            ZcPProMake make = (ZcPProMake) list.get(0);            bill.setZcMakeLinkMan(make.getZcMakeLinkman());            bill.setZcMakeLinkManTel(make.getZcMakeTel());          }        }        bill.setPackCode(ht.getZcHtCode());        bill.setZcSuLinkMan(ht.getZcSuLinkman());        bill.setZcSuCode(ht.getZcSuCode());        bill.setZcSuName(ht.getZcSuName());        bill.setZcSuLinkMan(ht.getZcSuLinkman());        bill.setZcSuLinkManTel(ht.getZcSuTel());        bill.setItemList(billItemList);        refreshData();        setEditingObject(bill);      }    }    public TableModel createTableModel(List showDatas) {      ZcEbYanShouBill bill = (ZcEbYanShouBill) listCursor.getCurrentObject();      Object data[][] = new Object[showDatas.size()][columNames.length];      for (int i = 0; i < showDatas.size(); i++) {        ZcXmcgHt rowData = (ZcXmcgHt) showDatas.get(i);        int col = 0;        data[i][col++] = rowData.getZcHtCode();        data[i][col++] = rowData.getZcBidContent();        data[i][col++] = rowData.getZcSuCode();        data[i][col++] = rowData.getZcSuName();        data[i][col++] = rowData.getZcSuLinkman();      }      MyTableModel model = new MyTableModel(data, columNames) {        @Override        public boolean isCellEditable(int row, int colum) {          return false;        }      };      return model;    }    public boolean isMultipleSelect() {      return false;    }  }  private class ProjSelectedHandler implements IForeignEntityHandler {    private final String columNames[];    public ProjSelectedHandler(String columNames[]) {      this.columNames = columNames;    }    public void excute(List selectedDatas) {      ZcEbYanShouBill bill = (ZcEbYanShouBill) listCursor.getCurrentObject();      if (selectedDatas == null || selectedDatas.size() == 0) {        bill.setProjCode(null);        bill.setProjName(null);        bill.setAgency(null);        bill.setExecutor(null);        bill.setExecutorName(null);        bill.setOrgCode(null);        zbDto.setZcText0(null);      } else {        for (Object object : selectedDatas) {          ZcPProMake zcPProMake = (ZcPProMake) object;          bill.setProjCode(zcPProMake.getZcMakeCode());          bill.setProjName(zcPProMake.getZcMakeName());          bill.setAgency(zcPProMake.getAgency());          bill.setExecutor(zcPProMake.getExecutor());          bill.setExecutorName(zcPProMake.getExecutorName());          bill.setZcMakeLinkMan(zcPProMake.getZcMakeLinkman());          bill.setZcMakeLinkManTel(zcPProMake.getZcMakeTel());          bill.setOrgCode(zcPProMake.getOrgCode());          angcy = zcPProMake.getAgency();          orgCode = zcPProMake.getOrgCode();          zbDto.setZcText0(zcPProMake.getZcMakeCode());        }      }      bill.setPackName("");      setEditingObject(bill);    }    /*     * 清空外部实体对应的数据     */    public void afterClear() {      ZcEbYanShouBill bill = (ZcEbYanShouBill) listCursor.getCurrentObject();      bill.setProjCode(null);      bill.setProjName(null);      bill.setAgency(null);      bill.setExecutor(null);      bill.setExecutorName(null);      bill.setOrgCode(null);      zbDto.setZcText0(null);      bill.setZcSuLinkMan(null);      bill.setZcSuCode(null);      bill.setZcSuName(null);      bill.setZcSuLinkMan(null);      bill.setZcSuLinkManTel(null);      List detailList = new ArrayList();      bill.setItemList(detailList);      bill.setZcMakeLinkMan(null);      bill.setZcMakeLinkManTel(null);      bill.setPackName(null);      bill.setCoCode(null);      bill.setCoName(null);      setEditingObject(bill);      refreshData();    }    public TableModel createTableModel(List showDatas) {      Object data[][] = new Object[showDatas.size()][columNames.length];      for (int i = 0; i < showDatas.size(); i++) {        ZcPProMake zcPProMake = (ZcPProMake) showDatas.get(i);        int col = 0;        data[i][col++] = zcPProMake.getZcMakeCode();        data[i][col++] = zcPProMake.getZcMakeName();      }      MyTableModel model = new MyTableModel(data, columNames) {        @Override        public boolean isCellEditable(int row, int colum) {          return false;        }      };      return model;    }    public boolean isMultipleSelect() {      return false;    }  }}